package com.wl.cloud.system.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.wl.cloud.core.model.AbstractBaseDeleteModel;
import com.wl.cloud.system.support.utils.ConstantSystem;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * @author: wanglin
 * @date: 2023-09-13 周三
 * @Version: 1.0
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity(name = SysMenu.TABLE_NAME)
@Table(appliesTo = SysMenu.TABLE_NAME, comment = "菜单表")
@TableName(value = SysMenu.TABLE_NAME)
public class SysMenu extends AbstractBaseDeleteModel {
    public static final String TABLE_NAME = ConstantSystem.TABLE_PREFIX + "menu";

    @Column(columnDefinition = "varchar(100) comment '菜单名称'")
    private String name;
    @Column(columnDefinition = "varchar(32) comment '上级菜单id'")
    private String parentId;
    @Column(columnDefinition = "int(1) comment '菜单级数:1,2,3'")
    private Integer level;

    @Column(name = "icon", columnDefinition = "varchar(100) comment '图标'")
    private String icon;
    @Column(name = "orderIndex", columnDefinition = "int(3) comment '排序号'")
    private Integer orderIndex;
    @Column(name = "description", columnDefinition = "varchar(100) comment '描述'")
    private String description;

    @Column(name = "isHidden", columnDefinition = "int(1) default 0 comment '是否隐藏，默认0显示，1隐藏'")
    private Integer isHidden;
    @Column(name = "isControlled", columnDefinition = "int(1) default 1 comment '是否受控制，默认1-受控，0-不受控；不受控的菜单，所有人都可以访问'")
    private Integer isControlled;

    /** 路由地址 */
    @Column(columnDefinition = "varchar(100) comment '菜单路径，路由地址'")
    private String path;

    @Column(columnDefinition = "varchar(100) comment '组件路径'")
    private String component;

    @Column(columnDefinition = "varchar(200) default '#' comment '菜单URL'")
    private String url;

    /** 打开方式（menuItem页签 menuBlank新窗口） */
    @Column(columnDefinition = "varchar(20) comment 'menuItem页签 menuBlank新窗口'")
    private String target;

    /** 类型（M目录 C菜单 F按钮） */
    @Column(columnDefinition = "char(1) default '' comment '菜单类型（M目录 C菜单 F按钮）'")
    private String type;

    /** 菜单状态（0显示 1隐藏） */
//    @Column(columnDefinition = "char(1) default '0' comment '菜单状态（0显示 1隐藏）'")
//    private String visible;

    /** 是否刷新（0刷新 1不刷新） */
    @Column(columnDefinition = "int(1) default 1 comment '是否刷新（0刷新 1不刷新）'")
    private String isRefresh;

    /** 权限字符串 */
    @Column(columnDefinition = "varchar(100) comment '权限字符串'")
    private String perms;

    @Column(columnDefinition = "int(1) not null default 0 comment '状态,0:正常 ；1:禁用'")
    private Integer status;

    @Column(columnDefinition = "int(1) not null default 0 comment '是否为外链（0否 1是）'")
    private Integer isFrame;

    @Column(columnDefinition = "int(1) not null default 0 comment '是否缓存（0缓存 1不缓存）'")
    private Integer isCache;

    /** 路由参数 */
    @Column(columnDefinition = "varchar(100) comment '路由参数'")
    private String query;
}
